 //
//  MPTLiveLoginProtocolVC.m
//  MPTLive
//
//  Created by caixun on 16/2/1.
//  Copyright © 2016年 Jeakin. All rights reserved.
//

#import "MPTLiveLoginProtocolVC.h"


@interface MPTLiveLoginProtocolVC ()


@end


@implementation MPTLiveLoginProtocolVC


#pragma mark - ********************** View Lifecycle **********************

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    [self initVariable]; /// 初始化变量
    [self initViews]; /// 初始化界面
    
    [self req_URL_xxx]; /// 发送请求
    
    [self regNotification]; /// 注册消息
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

- (void)dealloc
{
    // 一定要关注这个函数是否被执行了！！！
}


#pragma mark - ********************** Init All Views **********************

- (void)initVariable
{
    
}

- (void)initViews
{
    [self initNavView]; /// 初始化Nav导航栏
    
    /// 根据界面情况，决定是单独写函数，或直接写Views
    [self initMainViews];
}

- (void)initNavView
{
    /// 创建导航栏
    [self createNavBarViewWithTitle:@"用户协议"];
    /// 创建左侧按钮
    [self createNavLeftBtnWithItem:@""
                            target:self
                            action:@selector(btnClickBack:)];
    self.superNavBarView.backgroundColor = RGBAColor(254, 222, 9, 1);
    self.superNavBarView.viewBottomLine.backgroundColor = RGBAColor(254, 222, 9, 1);
    [self.superNavBarView.btnLeft setImage:[UIImage imageNamed:@"CommonBack"] forState:UIControlStateNormal];
}

- (void)initMainViews
{
    NSURL *url =[NSURL URLWithString:@"http://www.miaopai.com/live_protocol.html"];
    NSURLRequest *request =[NSURLRequest requestWithURL:url];
    
    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,
                                                                     TP_NavBar_H,
                                                                     screenW,
                                                                     screenH-TP_NavBar_H)];
    webView.scalesPageToFit = YES;//自动对页面进行缩放以适应屏幕
    [self.view addSubview:webView];
    [webView loadRequest:request];
}


#pragma mark - ********************** Functions **********************

#pragma mark - 注册消息

- (void)regNotification
{
    
}

#pragma mark - demo

- (void)demo
{
    
}


#pragma mark - ********************** Button Touch Event **********************

- (void)btnClickBack:(TPButton *)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}


#pragma mark - ********************** Net Connection Event **********************

#pragma mark - 请求 xxx

- (void)req_URL_xxx
{
    
}

#pragma mark - 处理 xxx

//- (void)reqSucc_URL_xxx:(TPRequest *)req
//{
//    
//}
//
//- (void)reqFail_URL_xxx:(TPRequest *)req
//{
//    
//}


#pragma mark - ********************** Delegate Event **********************

#pragma mark - 代理 xxx



#pragma mark - ********************** Notification Event **********************

#pragma mark - 通知 xxx



@end
